package com.xjj.order.controller;

import com.xjj.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanghejie
 * @date 2020/7/20 15:56
 */
@RestController
@RefreshScope
public class OrderController {//ServerController

    @Autowired
    private OrderService orderService;

    @GetMapping(value = "/buy/{num}")
    public String buy(@PathVariable(value = "num") Integer num) {
        return orderService.createOrder(num);
    }
}
